local renshi = fk.CreateSkill {
  name = "th_renshi",
}

renshi:addEffect("active", {
  anim_type = "support",
  prompt = "#th_renshi",
  expand_pile = "th_byakuren_song",
  min_card_num = 1,
  target_num = 1,
  can_use = function(self, player)
    return #player:getPile("th_byakuren_song") > 0
  end,
  card_filter = function(self, player, to_select, selected)
    return player:getPileNameOfId(to_select) == "th_byakuren_song"
  end,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:moveCardTo(effect.cards, Player.Special, target, fk.ReasonPut, renshi.name, "th_byakuren_song", true, player)
    if player:usedSkillTimes(renshi.name, Player.HistoryPhase) == 1 and #player:getPile("th_byakuren_song") > 0 then
      room:askToUseRealCard(player, {
        pattern = player:getPile("th_byakuren_song"),
        skill_name = renshi.name,
        prompt = "#th_renshi-use",
        expand_pile = "th_byakuren_song"
      })
    end
  end
})

Fk:loadTranslationTable{
  ["th_renshi"] = "仁施",
  [":th_renshi"] = "出牌阶段，你可以将任意张“颂”置于一名其他角色的武将牌上，若为本阶段首次发动，你可以使用你武将牌上的一张“颂”。",

  ["#th_renshi"] = "仁施：将任意张“颂”置于一名其他角色的武将牌上，若为本阶段首次发动，你可以使用你武将牌上的一张“颂”",

  ["#th_renshi-use"] = "仁施：你可以使用你武将牌上的一张“颂”",
}

return renshi